package com.buding.fx.utils;

import com.buding.fx.common.enums.PosEnum;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;

public class NotifyThread implements Runnable {


    BorderPane borderPane; //当前布局的顶级类

    Node  showNode ;

    PosEnum pos ;

    public  NotifyThread(BorderPane borderPane,Node showNode,PosEnum pos){
        this.borderPane = borderPane;
        this.showNode = showNode;
        this.pos = pos;
    }

    @Override
    public void run() {
        if (borderPane!=null && showNode!=null && pos!=null){
            if (pos== pos.TOP){
                borderPane.setTop(showNode);
            }else if (pos==pos.CENTER){
                borderPane.setCenter(showNode);
            }else if (pos==pos.LEFT){
                borderPane.setLeft(showNode);
            }
        }
    }
}


